<h1> Relatório: <small>Nome das raças de cachorros e gatos que tenham gasto maior que a média por venda ordenado em ordem descrecente</small></h1>
<code>SELECT p.raca, SUM(v.total) AS total
    FROM pet p
    JOIN venda v USING(idpet)
    WHERE
    p.especie IN ('cachorro', 'gato')
    GROUP BY p.raca
    HAVING total > (SELECT AVG(v.total) FROM venda v)
    ORDER BY total DESC </code><br/><br/>
<table class="table table-striped table-hover">
    <tr>
        <th>Raça</th>
        <th>Total</th>
    </tr>
    <?php foreach ($result as $ele) { ?>
        <tr>
            <td><?= $ele['raca'] ?></td>
            <td><?= $ele['total'] ?></td>
        </tr>
    <?php } ?>
</table>
